/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.edmo.fastener.business;

import com.edmo.fastener.domain.Customer;
import com.edmo.fastener.domain.Supplier;
import java.util.ArrayList;
import java.util.List;
import javax.crypto.SecretKey;

/**
 *
 * @author Alexx
 */
public class ListofCustomersnSuppliers {
    private static List<Customer> customers = new ArrayList<Customer>();
    private static List<Supplier> suppliers = new ArrayList<Supplier>();
    private static volatile Long orderId;
    private static SaverToDB saverToDB;
    
    private static SecretKey key;
    
    private ListofCustomersnSuppliers(){}
    
    private static class SingletonHolder {
       private final static ListofCustomersnSuppliers instance = new ListofCustomersnSuppliers();
    }

    public static SaverToDB getSaverToDB() {
        return saverToDB;
    }

    public static SecretKey getKey() {
        return key;
    }

    public static void setKey(SecretKey key) {
        ListofCustomersnSuppliers.key = key;
    }

    public static void setSaverToDB(SaverToDB saverToDB) {
        ListofCustomersnSuppliers.saverToDB = saverToDB;
    }

  
    public static ListofCustomersnSuppliers getInstance(){
        return SingletonHolder.instance;
    }

    public static List<Customer> getCustomers() {
        return customers;
    }

    public static void setCustomers(List<Customer> customers) {
        ListofCustomersnSuppliers.customers = customers;
    }

    public static List<Supplier> getSuppliers() {
        return suppliers;
    }

    public static void setSuppliers(List<Supplier> suppliers) {
        ListofCustomersnSuppliers.suppliers = suppliers;
    }

    public static synchronized Long getOrderId() {
        return ++orderId;
    }

    public static void setOrderId(Long orderId) {
        ListofCustomersnSuppliers.orderId = orderId;
    }

}
